package com.bj58.mis.apm.server.kylin.call;

import java.sql.Connection;
import java.sql.Driver;
import java.util.Properties;

public class KylinJDBC {

    public static Connection getConnection(String projectName){
        try {
            Driver driver = (Driver) Class.forName("org.apache.kylin.jdbc.Driver").newInstance();
            Properties info = new Properties();
            info.put("user", "ADMIN");
            info.put("password", "KYLIN");
//            return driver.connect("jdbc:kylin://10.126.89.86:7070/"+projectName, info);
            Connection conn = driver.connect("jdbc:kylin://10.126.99.160:7070/"+projectName, info);
            conn.setAutoCommit(true);
            return conn;
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }

}
